package cn.hs.controller;

import cn.hs.entity.ConsultSpecialty;
import cn.hs.entity.Specialty;
import cn.hs.mapper.ConsultSpecialtyMapper;
import cn.hs.service.ConsultSpecialtyService;
import cn.hs.service.ConsultlevelService;
import cn.hs.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ConsultSpecialtyController
 * @Description TODO
 * @Author yyk
 * @Date 2024年10月24日 21:25
 * @Version 1.0
 */

@RestController
@RequestMapping("/ConsultSpecialtyController")
public class ConsultSpecialtyController {
    @Autowired
 private ConsultSpecialtyService consultSpecialtyService;
    @RequestMapping("/insert")
    public Result insert(ConsultSpecialty consultSpecialty) {
        int insert = consultSpecialtyService.insert(consultSpecialty);
        if (insert > 0) {
   return Result.success(insert);
}else {
   return Result.error();
}
}
@GetMapping("/delete")
    public Result delete(@RequestParam(value = "consultid") Integer consultid, @RequestParam(value = "specialtyid") Integer specialtyid) {
    int delete = consultSpecialtyService.delete(consultid, specialtyid);
    if (delete > 0) {
        return Result.success(delete);
    }else {
        return Result.error();
    }
}


}
